package kuzmenkov.oip.service;

import kuzmenkov.oip.service.impl.Chunk;
import kuzmenkov.oip.service.impl.CommentItem;

import java.util.List;

/**
 * Interface describes managing of contacts. It serves the contact controller.
 * User: Michael Kuzmenkov
 * Date: 27.03.2009
 * Time: 15:25:02
 */
public interface CommentService {

    /**
     *
     * @return a name of a current module
     * @throws Exception
     */
    String getModuleName() throws Exception;

    /**
     * 
     * @return list of comments of a current module
     */
    List<CommentItem> getCommentItems() throws Exception;

    /**
     * Changes a visible chunk of comments
     * @param number the number of the chunk
     */
    void chunking (int number);

    /**
     * 
     * @return divided comments of a current module
     */
    List<Chunk> getChunks();

    /**
     * Stores a comment into a db
     * @param userName a name of a user who has written the comment
     * @param email an email of the user
     * @param message text of the comment
     */
    void storeComment(String userName, String email, String message) throws Exception;

    /**
     * 
     * @return an index of a current visible chunk of comments
     */
    int getCurrentChunkIndex();

}